package com.huawei.crm.sample.domain.order.model.aggragate;

import com.huawei.crm.sample.domain.order.model.entity.OrderItem;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
public class Order {
    private String orderId;
    private String customerId;
    private List<OrderItem> items;
    private LocalDateTime createdAt;
    private String status;

    public static Order placeOrder(String customerId, List<OrderItem> items) {
        Order order = new Order();
        order.setCustomerId(customerId);
        order.setItems(items);
        order.setCreatedAt(LocalDateTime.now());
        order.setStatus("CREATED");
        return order;
    }
} 